package com.shfl.task.logic.service.impl;

import com.shfl.task.logic.bean.TaskLogError;
import com.shfl.task.logic.mapper.TaskLogErrorMapper;
import com.shfl.task.logic.service.TaskLogErrorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class TaskLogErrorServiceImpl implements TaskLogErrorService {

    @Autowired
    private TaskLogErrorMapper taskLogErrorMapper;


    @Override
    @Transactional(rollbackFor = Exception.class)
    public void insertSelective(TaskLogError taskLogError) {
        if (taskLogError.getContent().length() > 450) {
            taskLogError.setContent(taskLogError.getContent().substring(0, 450));
        }
        taskLogErrorMapper.insertSelective(taskLogError);
    }
}
